package org.example.new_hbps_backend_reconstruction.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.example.new_hbps_backend_reconstruction.dto.AbnormalBloodDTO;
import org.example.new_hbps_backend_reconstruction.dto.PatientiListDTO;
import org.example.new_hbps_backend_reconstruction.mapper.PersureHeartRateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <h3>patient</h3>
 *
 * @author HuangJiayu
 * @description <p>患者列表服务类</p>
 * @date 2024-07-17 15:30
 **/
@Service
public class PatientListService {

    @Autowired
    private PersureHeartRateMapper persureHeartRateMapper;

    @Autowired
    private PersureHeartRateService persureHeartRateService;

    //	分页查询患者列表，需要结合患者基本信息，患者病情，患者血压心率记录
    public Page<PatientiListDTO> getPatientList(Page page, PatientiListDTO patientiListDTO) {
        return persureHeartRateMapper.selectPatientList(page, patientiListDTO);
    }

    //	分页查询血压异常记录
    public Page<AbnormalBloodDTO> getAbnormalPage(Page page, AbnormalBloodDTO abnormalBloodDTO) {
        //	如果查询日期不为空，查询当天所有数据
        return persureHeartRateMapper.selectAbnormalBloodList(page, abnormalBloodDTO);
    }
}
